module two {
	export class StarInfoItem extends eui.ItemRenderer implements eui.UIComponent {
		public constructor() {
			super();
		}

		public icon: eui.Image;
		public txt_name: eui.Label;
		public txt_title: eui.Label;

		protected childrenCreated(): void {
			super.childrenCreated();
			two.addTap(this.icon, () => {
				one.monitor.emit("onShowJewelry", { id: this.data.id });
			})
		}
		
		data:IStarConfig;

		protected dataChanged(): void {
			super.dataChanged();

			if (!this.data.icon) {
				return;
			}
			//6f6f6f  ffffff

			this.icon.source = `icon_q_${this.data.icon}_png`;

			this.txt_name.text = this.data.name;
			this.txt_title.text = this.data.title;

			if (User_getMyJewelryProxy.getInstance().getJewerlyCodeByStar(this.data.id)) {
				this.txt_name.textColor = 0xffffff;
				this.txt_title.textColor = 0xffffff;
			}
			else {
				this.txt_name.textColor = 0x6f6f6f;
				this.txt_title.textColor = 0x6f6f6f;
			}
		}
	}
}